  <%@page contentType="text/html; charset=UTF-8"%>
  <%@page import="org.json.simple.JSONObject"%>
    <%@page import="org.json.simple.JSONArray"%>
    <%@page import="br.com.Modelo.Endereco"%>
<%@page import="br.com.Dao.EnderecoDao"%>

    

<%




//connection statenebt
JSONArray respJson = new JSONArray(); 

JSONObject obj=new JSONObject();

    int id = Integer.parseInt(request.getParameter("id"));
    
    Endereco end = new EnderecoDao().getEnd(id);
    
    obj.put("id", id);
    obj.put("cep",end.getCep());
    obj.put("cidade", end.getCidade());
    obj.put("bairro",end.getBairro());
    obj.put("numero",end.getNumero());
    obj.put("rua",end.getRua());

   respJson.add(obj);
   
   out.println(respJson);

%>

